﻿<%@ Control Language="C#"  %>
<script runat="server">
    /* 数据绑定 */
    private string fileExt = "jpg";
    private int item_lang = 1;
    private int item_column = 0;
    protected void Page_Load(object sender, EventArgs e)
    {
        Advertisement Ad = new Advertisement();
        Item_Lang = Utils.GetQueryString("lang", 1);
        Item_Column = Utils.GetQueryString("Cid", 0);
        Repeater_List.DataSource = Ad.Advertisement_List(Item_Lang,Item_Column);
        Repeater_List.DataBind();
    }
    
    
    public int Item_Lang
    {
        get { return item_lang; }
        set { item_lang = value; }
    }
    
    /// <summary>
    /// 栏目ID，整型变量
    /// </summary>
    public int Item_Column
    {
        get { return item_column; }
        set { item_column = value; }
    }
    /// <summary>
    /// 展示文件扩展名
    /// </summary>
    public string FileExt
    {
        get { return fileExt; }
        set { fileExt = value; }
    }
   int GetTimeStatus(object dataitem, string Cname)
    {
        int values= Convert.ToInt32(DataBinder.Eval(dataitem, Cname).ToString());
        if (values > 0)
            return 1;
        return 0;
    }
    
</script>
<table class="datas">
<thead>
    <tr>
        <td></td>
        <td><%=Lang.Show("Picture")%></td>
        <td><%=Lang.Show("Title")%></td>
        <td><%=Lang.Show("Link")%></td>
        <td><%=Lang.Show("Order")%></td>
        <td><%=Lang.Show("Status")%></td>
        <td><%=Lang.Show("Published")%></td>
        <td><%=Lang.Show("ExpiredTime")%></td>
        <td class="Narrow"><%=Lang.Show("Edit") %></td>
        <td class="Narrow"><%=Lang.Show("Del") %></td>
    </tr>
</thead>
<tbody>
<asp:Repeater runat="server" ID="Repeater_List">
<ItemTemplate>
    <tr id="TR<%#Eval("Item_Id") %>" class="time_status<%#GetTimeStatus(Container.DataItem, "Time_Status") %>">
        <td><input type="checkbox" disabled="disabled" /></td>
        <td><img class="item_img" src="../DataFile/Ad/<%#Eval("Create_Time","{0:yyyyMM}") %>/<%#Eval("Create_Time","{0:ddHHmmss}") %>_ssss.<%=FileExt %>" /></td>
        <td><%#Eval("Item_Title")%></td>
        <td><code class="url" title="<%#Eval("Item_Url")%>"><%#Eval("Item_Url")%></code></td>
        <td><code><%#Eval("Orders")%></code></td>
        <td class="time_status<%#GetTimeStatus(Container.DataItem, "Time_Status") %>"><code class="time_status<%#GetTimeStatus(Container.DataItem, "Time_Status") %>"><%#Eval("Time_Status") %></code></td>
        <td><time><%#Eval("Create_Time","{0:yyyy/MM/dd HH-mm-ss}")%></time></td>
        <td><time><%#Eval("Maturity_Time","{0:yyyy/MM/dd}")%></time></td>
        <td><a href="Advertisement-AddEdit.aspx?id=<%#Eval("Item_Id") %>&lang=<%=Item_Lang %>"><%=Lang.Show("Edit") %></a></td>
        <td><a href="javascript:Del(<%#Eval("Item_Id") %>,10)" class="del"><%=Lang.Show("Del") %></a></td>
    </tr>
</ItemTemplate>
</asp:Repeater>
</tbody>
</table>